{% extends 'base.html' %}

{% block title %}
    发布博客
{% endblock %}

{% block header %}
    <link rel="stylesheet" href="{% static 'wangeditor/style.css' %}">
    <link rel="stylesheet" href="{% static 'css/edit.css' %}">
    <script src="{% static 'jquery/jquery-3.7.1.min.js' %}"></script>
    <script src="{% static 'wangeditor/index.js' %}"></script>
    <script src="{% static 'js/pub_blog.js' %}"></script>
{% endblock %}

{% block main %}
    <h2 class="mb-3">发布博客</h2>
    <div>
        <form action="" method="post">
        {% csrf_token %}
            <div class="my-3">
                <label for="" class="form-label">标题</label>
                <input type="text" name="title" class="form-control">
            </div>
            <div class="my-3">
                <label for="" class="form-label">分类</label>
                <div class="input-group mb-3">
                    <select class="form-select" id="category-select">
                        {% for category in categories %}
                        	<option value="{{ category.id }}">{{ category.name }}</option>
                        {% endfor %}

                    </select>
                    <label class="input-group-text" for="inputGroupSelect02">选择分类</label>
                </div>
            </div>
            <div class="my-3">
                <label for="" class="form-label">内容</label>
                <div id="editor—wrapper">
                    <div id="toolbar-container"><!-- 工具栏 --></div>
                    <div id="editor-container"><!-- 编辑器 --></div>
                </div>
            </div>
            <div class="text-end">
                <button class="btn btn-primary" id="submit-btn">发布博客</button>
            </div>
        </form>
    </div>

{% endblock %}
{% block footer %}
    <script src="{% static 'js/edit.js' %}"></script>
{% endblock %}